home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_mac.hqx / SRGP port to 5.0 (compressed) / SRGP_SPHIGS Root / MacSPHIGS / sph_face.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-11  |  3.8 KB  |  165 lines

  1. /**********************
  2.                       *
  3.  File                 * face.h
  4.                       *
  5.                       ********************************************************/
  6.  
  7. #ifndef _H_face_
  8. #define _H_face_
  9.  
  10.  
  11. /**********************
  12.                       *
  13.  Types              *
  14.                       *
  15.                       ********************************************************/
  16.  
  17.  
  18. /*****************************************************************************/
  19. /*
  20. /*   objType
  21. /*
  22. /*   Types of objects which our routines handle
  23. /*
  24. /*****************************************************************************/
  25.  
  26. typedef enum { objFace, objLine, objText, objPoint } objType;
  27.  
  28. /*****************************************************************************/
  29. /*
  30. /*   typeFace
  31. /*
  32. /*   Face specific fields
  33. /*
  34. /*****************************************************************************/
  35.  
  36. typedef struct _typeFace {
  37.      int        numPoints;       /* passed (need minimum 3 points) */
  38.      vertex_index *    points;        /* passed (no sentinel) */
  39. } typeFace;
  40.  
  41. /*****************************************************************************/
  42. /*
  43. /*   typeLine
  44. /*
  45. /*   Line specific fields
  46. /*
  47. /*****************************************************************************/
  48.  
  49. typedef struct _typeLine {
  50.      MAT3hvec            end1, end2;            /* passed */
  51. } typeLine;
  52.  
  53. /*****************************************************************************
  54. /*
  55. /*   typeText
  56. /*
  57. /*   Text specific fields
  58. /*
  59. /*****************************************************************************/
  60.  
  61. typedef struct _typeText {
  62.      char *            text;
  63. } typeText;
  64.  
  65. /*****************************************************************************/
  66. /*
  67. /*   typePoint
  68. /*
  69. /*   Point specific fields
  70. /*
  71. /*****************************************************************************/
  72.  
  73. typedef struct _typePoint {
  74.    char dummy;
  75. } typePoint;
  76.  
  77.  
  78. /*****************************************************************************/
  79. /*
  80. /*   obj
  81. /*
  82. /*   Data structure used for each object to be rendered
  83. /*   Object can be a face, line, point, or text item
  84. /*
  85. /*****************************************************************************/
  86.  
  87. typedef struct _obj {
  88.      
  89.      /* object type */
  90.      objType            type;        /* face, line, or text */
  91.      
  92.      /* pointer to the next object */
  93.      struct _obj *         next;
  94.  
  95.      /* normal (for face, text) */
  96.      MAT3hvec             normal;        /* passed for face */
  97.      
  98.      /* bounding cube */
  99.      /* for face: we calculate */
  100.      /* for point: pass coordinates in min[x], min[y], min[z] */
  101.      /* for line: we calculate */
  102.      /* for text: pass z in min[z], pass min and max [x] and [y] */
  103.      MAT3hvec            min;
  104.      MAT3hvec            max;
  105.      
  106.      /* color intensity */
  107.      double    intensity;      /* should actually be a field in "typeFace" structure */
  108.      
  109.      /* pointer to specifics */
  110.      attribute_group         attributes;
  111.  
  112.      /* plane equation */
  113.      double            directed_distance;
  114.      
  115.      /* object specifics */
  116.      union {
  117.       typeFace        face;
  118.       typeLine        line;
  119.       typeText        text;
  120.       typePoint        point;
  121.      } data;
  122.  
  123.      /* stored for all objects */
  124.      MAT3hvec            p_min;
  125.      MAT3hvec            p_max;
  126.      boolean            already_moved;
  127.      MAT3hvec            p_normal;
  128.      unsigned short        traversal_index;  /* used for pick correlation */
  129. } obj;
  130.  
  131.  
  132.  
  133.  
  134. /**********************
  135.                       *
  136.  Prototypes           *
  137.                       *
  138.                       ********************************************************/
  139.  
  140. /*
  141.  
  142. extern void cull(view_spec *vs);
  143. extern void clip(view_spec *vs);
  144. extern void map_to_canon(view_spec *vs);
  145. extern void generate_pdc_vertices(view_spec *vs);
  146. extern void zsort(view_spec *vs);
  147.  
  148. extern void debug_object(obj * head_of_list);
  149.  
  150. */
  151.  
  152. extern void convexify();
  153. extern void cull( );
  154. extern void clip( );
  155. extern void calc_intensity( );
  156. extern void map_to_canon( );
  157. extern void generate_pdc_vertices( );
  158. extern void zsort( );
  159.  
  160. #endif
  161.  
  162.  
  163.  
  164.  
  165.